<%@ page language="java" contentType="text/html;charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="${ctx }/css/b.css">

<title>${message.title}</title>
<link rel="stylesheet" type="text/css" href="${ctx }/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="${ctx }/css/css.css">
<link rel="stylesheet" type="text/css" href="${ctx }/css/mybutton.css">


<style>
			
		.board_parent_div{
			width: 100%;
			height: auto;
			overflow: hidden;
			font-size: 12px;
			font-family: "微软雅黑";
		}
		.board_div{
			width: 80%;
			margin-left: 4%;
			border-bottom: 1px solid #ccc;
		}
		.user,.friend{
			color:#2d64b3;
		}
		.send_time{
			color: #666;
			padding-right: : 3px;
		}
body { font-size: 72.5%; }
label, input { display: block; }
input.text { margin-bottom: 12px; width: 95%; padding: 0.4em; }
.validateTips { border: 1px solid transparent; padding: 0.3em; }
body { font-family: "Roboto-Regular","微软雅黑","宋体",Arial,sans-serif; font-size: 14px; line-height: 20px; color: rgb(102, 102, 102); text-align: center; }
a, a:link { color: rgb(102, 102, 102); text-decoration: none; }
a:hover, a:focus { color: rgb(0, 85, 128); text-decoration: underline; }
</style> 
<script src="${ctx}/assets/js/jquery.min.js"></script>  
</head>
<body style="background: white none repeat scroll 0% 0%; text-align: left;">
	<!--导航菜单-->
	<div class="MainMenu" style="margin-bottom: 8px;">
		<div class="MenuList" style="min-width: 500px; background: transparent none repeat scroll 0% 0%;">
			<dl>
				<dt>
					<a href="${ctx }/swzl/index"><div>首页</div></a>
				</dt>
			</dl>
			<dl >
				<dt>
					<c:if test="${not empty swzlUser}">
						<a href="${ctx }/swzl/userInfo?type=myInfo"><div>${swzlUser.name }</div></a>
					</c:if>
					<c:if test="${empty swzlUser}">
						<a href="${ctx }/swzl/userInfo?type=goLogin"><div>登录/注册</div></a>
					</c:if>
				</dt>
			</dl>
			<dl class="${typeParentId==1?'ch':'' }">
				<dt>
					<a href="${ctx }/swzl/index?typeParentId=1"><div>失物招领</div></a>
				</dt>
			</dl>
			<dl class="${typeParentId==2?'ch':'' }">
				<dt>
					<a href="${ctx }/swzl/index?typeParentId=2"><div>寻物启事</div></a>
				</dt>
			</dl>
			<dl class="${typeParentId==3?'ch':'' }">
				<dt>
					<a href="${ctx }/swzl/index?typeParentId=3"><div>我发布的</div></a>
				</dt>
			</dl>
			<c:if test="${not empty swzlUser}">
				<dl>
					<dt>
						<a href="${ctx }/swzl/userInfo?type=loginOut"><div>退出</div></a>
					</dt>
				</dl>
			</c:if>						
		</div>
	</div>
<!-- 导航菜单 -->






 <div class="content-rightk" style="margin: 0px auto; width: 1080px; background: transparent none repeat scroll 0% 0%; float: none;"> 

        <div class="content-right z_content" style="margin: 0px auto; width: 1070px; background: transparent none repeat scroll 0% 0%; float: none;">
          
          	<h5 style="background: rgb(221, 221, 221) none repeat scroll 0% 0%;">失物招领详情
          		
          		<c:if test="${message.createUse.id==swzlUser.id }">
	          		<select style=" float: right; width: 110px; height: 23px; font-size: 4px; line-height: 78px; padding-top: 0px;" onchange="updateState(this)">
		          		<option value="">请选择操作</option>
		          		<option value="4">完成</option>
		          		<option value="3">关闭</option>
	          		</select>
          		</c:if>
          	</h5>
          	
          
          <!-- start:表单开始 -->
          <div class="z_from">

            <!-- start:必填信息 -->
            <h4 style="border-top: 1px solid rgb(228, 55, 22);">物品信息</h4>
            <div class="form-horizontal">
            
            <!-- line1 -->
              <div class="control-group">
                <label class="control-label">标题：</label>
                <div class="controls">
                <div style="display: inline-block; width: 500px; line-height: 20px; background: white none repeat scroll 0% 0%;" class="notic_info">
							${message.title }
                </div>
                </div>
              </div>    
                       
            <!-- line2 -->
              <div class="control-group" style="background: rgb(255, 255, 255) none repeat scroll 0% 0%;">
              
              	<div style="background: rgb(255, 255, 255) none repeat scroll 0% 0%; width: 60%; display: inline-block;"> 
              	
                <label class="control-label">物品类别：</label>
                <div class="controls">
                <div style="display: inline-block; line-height: 20px;" class="notic_info">
						${message.messageType.name }
                </div>
                </div>
                
                </div>
                
                <div style="background: rgb(255, 255, 255) none repeat scroll 0% 0%; width: 30%; display: inline-block;">

                <label class="control-label">认领状态：</label>
                <div class="controls">
                <div style="display: inline-block; line-height: 20px;" class="notic_info">${message.stateStr}
                </div>
                </div>
                
                </div>
                                
              </div>
              
            <!-- line3 -->
              <div class="control-group" style="background: rgb(255, 255, 255) none repeat scroll 0% 0%;">
              
              	<div style="background: rgb(255, 255, 255) none repeat scroll 0% 0%; width: 60%; display: inline-block;"> 
              	
                <label class="control-label">信息类型：</label>
                <div class="controls">
                <div style="display: inline-block; width: 500px; line-height: 20px; background: white none repeat scroll 0% 0%;" class="notic_info">
<script type="text/javascript">/* Code removed by ScrapBook */</script>${message.messageType.parent.name }
                </div>
                </div>
                
                </div>
                
                <div style="background: rgb(255, 255, 255) none repeat scroll 0% 0%; width: 30%; display: inline-block;">

	              <label class="control-label">拾获日期：</label>
	              <div class="controls">
	              <div class="row-fluid z_select">
	                 <span class="notic_info">
	                 ${message.lostTime }
	                 </span>
	               </div>
	               </div>
                
                </div>
                                
              </div>              
       
                            
              
              <div class="control-group" id="province_group" style="margin-bottom: 0px; margin-top: 10px; background: rgb(255, 255, 255) none repeat scroll 0% 0%;">
                <label class="control-label">拾获区域：</label>
                <div class="controls" style="background: transparent none repeat scroll 0% 0%;">
                	<div class="row-fluid z_select" id="province_group_rightside_core" style="margin-bottom: 0px;">
					
					<span id="acprovinceInfos" class="notic_info" style="margin: 12px 0px 0px 3px; padding: 0px; float: left; text-align: center; line-height: 5px; height: 5px;">
						${message.address }						
					</span>
                	</div> 
                </div>
              </div>
              
         
                                         
                                                  

                          

              
              <div class="control-group" style="margin-top: 10px;">
                <label class="control-label">详情：</label>
                <div class="controls">
                <div style="display: inline-block; width: 500px; line-height: 20px; background: white none repeat scroll 0% 0%;" class="notic_info">
                ${message.detailContent }
                </div>
                </div>
              </div>             

                                                     
            
                           
                                                                
            </div>
         <!-- end:选填信息 -->
         
 <!-- start:发布人及发布日期 --> 
         <h4>发布者及发布日期</h4>
         <div class="form-horizontal">
         
              <!-- line1 -->
              <div class="control-group" style="background: rgb(255, 255, 255) none repeat scroll 0% 0%;">
              
              	<div style="background: rgb(255, 255, 255) none repeat scroll 0% 0%; width: 60%; display: inline-block;"> 
              	
                <label class="control-label">发布者：</label>
                <div class="controls">
                <div style="display: inline-block; background: white none repeat scroll 0% 0%;" class="notic_info">
                
				 
${message.createUse.name }
				 
                </div>
                </div>
                
                </div>
                
                           
                <div style="background: rgb(255, 255, 255) none repeat scroll 0% 0%; width: 30%; display: inline-block;">

	              <label class="control-label">发布日期：</label>
	              <div class="controls">
	              <div class="row-fluid z_select">
	                 <span class="notic_info">
	                 ${message.createTime }
	                 </span>
	               </div>
	               </div>
                
                </div>
                                                
              </div>   
              
         </div>
         
				      
		 <!-- end:发布人及发布日期 --> 				         
         
         <!-- start:联系方式 --> 
				
				        
				           
 
                                  
            <!-- end:联系方式 -->
            <!-- start:上传图片 -->
            
				
				        
				            
            <h4>物品图片</h4>
				<c:forEach var="img" items="${fn:split(message.imgs,',')}">
							  				         
	             <div class="form-horizontal">
	              <div class="control-group">
	                <div class="controls" style="border: 1px solid #ccc;margin-left: 0px;">
					  <img id="mypic" alt="" src="${ctx }/upload/${img}" data-bd-imgshare-binded="1">
	                </div>
	              </div>
				</div>
				</c:forEach>																
					
			<!-- end:上传图片 -->
		
		 <!-- start:验证并提交 -->
            <h4>留言信息</h4>
             <div class="form-horizontal">
             
              <div class="">
		<c:if test="${empty messageBoards}"><div class="not_board" style="    margin-left: 20px;">暂无留言</div></c:if>
		<c:if test="${not empty messageBoards }">
			<c:forEach items="${messageBoards}" var="board">
				<div class="board_div">
				<p>
					<img src="${ctx }/upload/${board.user.headImg}" style="vertical-align: middle;width: 50px;">
					<span class="send_time">${board.sendTime}</span>
					<span class="user">${board.user.name}</span>@<span class="friend">${board.firend.name}</span>：<span class="content">${board.content }</span>
					<span style="color: #2d64b3" onclick="boardMsg(${board.user.id},${ board.id},'${board.user.name }')">回复</span>
				</p>
				<c:if test="${not empty board.childrens }">
				<c:forEach items="${board.childrens}" var="children">
					<p style="margin-left: 5%">
						<img src="${ctx }/upload/${children.user.headImg}" style="vertical-align: middle;width: 40px;">
						<span class="send_time">${children.sendTime}</span>
						<span class="user">${children.user.name}</span>回复@<span class="friend">${children.firend.name}</span>：<span class="content">${children.content }</span>
						
						<span style="color: #2d64b3" onclick="boardMsg(${children.user.id},${children.parentID},'${children.user.name}')">回复</span>
					</p>
				</c:forEach>
				</c:if>
			</div>
			</c:forEach>
		</c:if>
		<input type="hidden" value="" id="parentId"/>
		<input type="hidden" value="" id="firendId"/>
		<input type="hidden" value="" id="prefix"/>
		<input type="hidden" value="${message.id }" id="messageId"/>
		<textarea rows="4" cols="5" style="width: 70%;margin-top: 20px;" id="content"></textarea>
		<button style="margin-top: 8px; width: 100px; display: block;" class="button button-glow button-rounded button-raised button-primary" id="addLabProdPic">提交</button>
		</div>
		

	</div>             
          
          
          <script type="text/javascript">
         		
          	function boardMsg(firendId,parentId,name){
	          	$("#parentId").val(parentId);
	          	$("#firendId").val(firendId);
	          	$("#content").val("回复@"+name+"：").focus();
	          	$("#prefix").val("回复@"+name+"：");
          	};
          	$('#content').bind('input propertychange', function() {  
          		var content=$("#content").val();
          		if(content==null||content==""){
          			$("#parentId").val("");
    	          	$("#firendId").val("");
    	        	$("#prefix").val("");
          		}
          		if(content!=null&&content!=""){
          			if(content.length<$("#prefix").val().length){
          				$("#prefix").val("");
          				$("#parentId").val("");
          				$("#firendId").val("");
          			}
          		}
          	});  
          	$("#addLabProdPic").on("click",function(){
          		var parentId=$("#parentId").val();
	          	var firendId=$("#firendId").val();
	        	var prefix=$("#prefix").val();
	        	var content=$("#content").val();
	        	var datas={"parentId":parentId,"firendId":firendId,"prefix":prefix,"content":content,"messageId":$("#messageId").val()};
				$.ajax({
					  type: 'post',
					  url: "${ctx}/auth/swzl/message?type=submitBoard",
					  data: datas,
					  dataType: "json",
					  success: function(data){
						  if(data.returnCode==200){
							  location.reload();
						  }else{
							  alert(data.returnMsg);
						  }
					  },error:function(){
						  alert("系统异常");
					  }
				});
	        	
	        	
          	});
          	function updateState(obj){
          		var state=$(obj).val();
          		var id=$("#messageId").val();
          		if(!state){
          			return;
          		}
          		var params={"id":id,"state":state};
          		
          		$.ajax({
					  type: 'post',
					  url: "${ctx}/auth/swzl/message?type=updateState",
					  data: params,
					  dataType: "json",
					  success: function(data){
						  if(data.returnCode==200){
							  location.reload();
						  }else{
							  alert(data.returnMsg);
						  }
					  },error:function(){
						  alert("系统异常");
					  }
				});
          	}
          
          </script>  
              
              




              
              
              
              
			</div>
					
			<!-- end:验证并提交 -->
			
          </div>
        </div>

	
<br/><br/>





<div style="width: 100%; background: rgb(239, 239, 239) none repeat scroll 0% 0%; padding: 0px; height: 85px; display: block; font-size: 11px; line-height: 15px; margin: 0px; font-family: Roboto-Regular,微软雅黑,宋体,Arial,sans-serif;"> 
      <div style="vertical-align: middle; background: transparent none repeat scroll 0% 0%; padding-top: 8px; text-align: center; color: rgb(102, 102, 102);">
        ©Copyright2017 <a href="#" target="_blank" style="color: rgb(102, 102, 102);">长江师范失物招领</a> All Rights Reserved
	  </div>
       
      <div style="vertical-align: middle; background: transparent none repeat scroll 0% 0%; margin: 10px auto; text-align: center;">
                 邮箱：<a href="#">895243872@qq.com</a>
	  </div>
       
	 	<div style="width: 300px; margin: 0px auto; padding: 0px; text-align: center;">
	 		<a target="_blank" href="#" style="display: inline-block; text-decoration: none; height: 20px; line-height: 20px;">
		 		<img src="${ctx }/images/gongAnBeiAnLogo.png" style="float: left;" data-bd-imgshare-binded="1">
		 		<p style="float: left; height: 20px; line-height: 20px; margin: 0px 0px 0px 5px; color: rgb(147, 147, 147);">
		 			渝公网安备 000000000000000号
		 		</p>
	 		</a>
	 	</div>
		 	   
</div>





</body>
</html>


